<?php 
$this->breadcrumbs()->addPage('Tipos de Processo', 'tiposprocesso');
$this->breadcrumbs()->addPage('Editar Tipo de Processo', 'tiposprocesso', 'editar', array('id' => $this->id));
$this->breadcrumbs()->addPage('Assuntos');
echo $this->breadcrumbs()->render(); 

if ($this->isEdit):
    echo $this->tabs()->openList();
    echo $this->tabs()->addTab($this->simpleUrl('editar', null, array('id' => $this->id)), 'Dados Gerais');
    echo $this->tabs()->addTab($this->simpleUrl('assuntos', null, array('id' => $this->id)), 'Assuntos', true);
    echo $this->tabs()->closeList();
endif; 

echo $this->pagenav()->openList(); 
echo $this->pagenav()->link($this->simpleUrl('editar', $this->controller, array('id' => $this->id)), 'Voltar');
echo $this->pagenav()->link($this->simpleUrl('inserir',
                                             'assuntos',
                                             array('tipoprocesso' => $this->id)),
                            'Inserir Outro Assunto');
echo $this->pagenav()->defaultHelperLinks('assuntos.html');
echo $this->pagenav()->closeList();
?>

<div id="article">
    <form action="<?php echo $this->simpleUrl('remover', 'assuntos') ?>" method="post">
	    <input type="hidden" name="tipoProcessoId" value="<?php echo $this->id ?>">
	    <?php
	    echo $this->buttonlist()->open();
	    echo $this->buttonlist()->defaultBlockActionsDescription();
	    echo $this->buttonlist()->button('Remover');
	    echo $this->buttonlist()->close(true);
	    ?>
    
    	<table class="grid">
	        <thead>
	        	<tr>
	        		<th><input type="checkbox" id="checkbox_checkAll" /></th>
        			<th>Nome</th>
        			<th>Ações</th>
        		</tr>
        	</thead>
        	<tbody>
        		<?php $i = 0 ?>
        		<?php if (count($this->assuntos) > 0): foreach ($this->assuntos as $a): ?>
        		<tr class="<?php echo (++$i % 2) ? 'even' : 'odd' ?>">
        			<td><input type="checkbox" name="assuntos[]" value="<?php echo $p->id ?>" /></td>
        			<td><?php echo $a->nome ?></td>
        			<td>
        				<a href="<?php echo $this->url(array('action' => 'editar', 'controller' => 'assuntos', 'id' => $a->id)) ?>">
        					Editar
        				</a>
        			</td>
        		</tr>
        		<?php endforeach; else: ?>
        		<tr>
        			<td colspan="3">Nenhum assunto encontrado.</td>
        		</tr>
        		<?php endif ?>
        	</tbody>
        </table>
    </form>
</div>